package com.lebang.feign.bus;

import com.lebang.feign.bus.fallback.CencesApiCountFallback;
import com.lebang.model.RequestUserInfo;
import com.lebangweb.response.JsonData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

/**
 * @author ljx
 */
@FeignClient(name = "wangzhuan-bus", contextId = "wangzhuan-cences-apicount", fallback = CencesApiCountFallback.class)
public interface CencesApiCountFeign {
    /**
     * 分页
     * @param page
     * @param limit
     * @param appStore
     * @param star
     * @param end
     * @return
     */
    @PostMapping("/cences/apicount/list")
    JsonData selectData(@RequestParam("page") Integer page,
                        @RequestParam("limit") Integer limit,
                        @RequestParam("appStore")String appStore,
                        @RequestParam("star")Integer star,
                        @RequestParam("end")Integer end);

    /**
     * 统计
     * @param end
     * @param appStore
     * @return
     */
    @PostMapping("/cences/apicount/lastCheck")
    JsonData starDataInit(@RequestParam("end") LocalDateTime end,
                          @RequestParam("appStore") String appStore);

    /**
     * 删除
     * @param time
     * @return
     */
    @PostMapping("/cences/apicount/delete")
    JsonData deleteRecord(@RequestParam("time") Integer time);
}
